/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.railway.app;

import java.awt.CardLayout;
import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 *
 * @author Kenny
 */
public class ScheduleForm extends javax.swing.JPanel {

    private CardLayout cl;

    /**
     * Creates new form ScheduleForm
     */
    public ScheduleForm() {
        initComponents();
        cl = (CardLayout) jpTaskContent.getLayout();
        jpTaskContent.add(new JPanel(), "null");
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    public static void main(String args[]) {
        JFrame frame = new JFrame();
        frame.add(new ScheduleForm());
        frame.setVisible(true);
        frame.pack();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jpTaskContent = new javax.swing.JPanel();
        jpButtons = new javax.swing.JPanel();
        jbtStation = new javax.swing.JButton();
        jbtRoute = new javax.swing.JButton();
        jbtSchedule = new javax.swing.JButton();
        jbtFare = new javax.swing.JButton();
        jbtDiscount = new javax.swing.JButton();

        setBackground(new java.awt.Color(236, 240, 241));
        setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Route and schedule maintenance", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Emoji", 0, 12))); // NOI18N
        setPreferredSize(new java.awt.Dimension(890, 539));
        setLayout(null);

        jpTaskContent.setLayout(new java.awt.CardLayout());
        add(jpTaskContent);
        jpTaskContent.setBounds(10, 70, 870, 460);

        jpButtons.setLayout(null);

        jbtStation.setBackground(new java.awt.Color(52, 152, 219));
        jbtStation.setFont(new java.awt.Font("Segoe UI Emoji", 0, 14)); // NOI18N
        jbtStation.setForeground(new java.awt.Color(255, 255, 255));
        jbtStation.setText("Station ");
        jbtStation.setFocusPainted(false);
        jbtStation.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtStationActionPerformed(evt);
            }
        });
        jpButtons.add(jbtStation);
        jbtStation.setBounds(0, 5, 150, 50);

        jbtRoute.setBackground(new java.awt.Color(52, 152, 219));
        jbtRoute.setFont(new java.awt.Font("Segoe UI Emoji", 0, 14)); // NOI18N
        jbtRoute.setForeground(new java.awt.Color(255, 255, 255));
        jbtRoute.setText("Route");
        jbtRoute.setFocusPainted(false);
        jbtRoute.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtRouteActionPerformed(evt);
            }
        });
        jpButtons.add(jbtRoute);
        jbtRoute.setBounds(180, 5, 150, 50);

        jbtSchedule.setBackground(new java.awt.Color(52, 152, 219));
        jbtSchedule.setFont(new java.awt.Font("Segoe UI Emoji", 0, 14)); // NOI18N
        jbtSchedule.setForeground(new java.awt.Color(255, 255, 255));
        jbtSchedule.setText("Schedule");
        jbtSchedule.setFocusPainted(false);
        jbtSchedule.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtScheduleActionPerformed(evt);
            }
        });
        jpButtons.add(jbtSchedule);
        jbtSchedule.setBounds(360, 5, 150, 50);

        jbtFare.setBackground(new java.awt.Color(52, 152, 219));
        jbtFare.setFont(new java.awt.Font("Segoe UI Emoji", 0, 14)); // NOI18N
        jbtFare.setForeground(new java.awt.Color(255, 255, 255));
        jbtFare.setText("Miscellaneous");
        jbtFare.setFocusPainted(false);
        jbtFare.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtFareActionPerformed(evt);
            }
        });
        jpButtons.add(jbtFare);
        jbtFare.setBounds(720, 5, 150, 50);

        jbtDiscount.setBackground(new java.awt.Color(52, 152, 219));
        jbtDiscount.setFont(new java.awt.Font("Segoe UI Emoji", 0, 14)); // NOI18N
        jbtDiscount.setForeground(new java.awt.Color(255, 255, 255));
        jbtDiscount.setText("Discount");
        jbtDiscount.setFocusPainted(false);
        jbtDiscount.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtDiscountActionPerformed(evt);
            }
        });
        jpButtons.add(jbtDiscount);
        jbtDiscount.setBounds(540, 5, 150, 50);

        add(jpButtons);
        jpButtons.setBounds(10, 15, 870, 55);
    }// </editor-fold>//GEN-END:initComponents

    private void jbtStationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtStationActionPerformed
        jbtStation.setBackground(new Color(41, 128, 185));
        jbtRoute.setBackground(new Color(52, 152, 219));
        jbtSchedule.setBackground(new Color(52, 152, 219));
        jbtFare.setBackground(new Color(52, 152, 219));
        jbtDiscount.setBackground(new Color(52, 152, 219));
        jpTaskContent.add(new StationPanel(), "station");
        cl.show(jpTaskContent, "station");
    }//GEN-LAST:event_jbtStationActionPerformed

    private void jbtRouteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtRouteActionPerformed
        jbtStation.setBackground(new Color(52, 152, 219));
        jbtRoute.setBackground(new Color(41, 128, 185));
        jbtSchedule.setBackground(new Color(52, 152, 219));
        jbtFare.setBackground(new Color(52, 152, 219));
        jbtDiscount.setBackground(new Color(52, 152, 219));
        jpTaskContent.add(new RoutePanel(), "route");
        cl.show(jpTaskContent, "route");
    }//GEN-LAST:event_jbtRouteActionPerformed

    private void jbtScheduleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtScheduleActionPerformed
        jbtStation.setBackground(new Color(52, 152, 219));
        jbtRoute.setBackground(new Color(52, 152, 219));
        jbtSchedule.setBackground(new Color(41, 128, 185));
        jbtFare.setBackground(new Color(52, 152, 219));
        jbtDiscount.setBackground(new Color(52, 152, 219));
        jpTaskContent.add(new SchedulePanel(), "schedule");
        cl.show(jpTaskContent, "schedule");
    }//GEN-LAST:event_jbtScheduleActionPerformed

    private void jbtFareActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtFareActionPerformed
        jbtStation.setBackground(new Color(52, 152, 219));
        jbtRoute.setBackground(new Color(52, 152, 219));
        jbtSchedule.setBackground(new Color(52, 152, 219));
        jbtFare.setBackground(new Color(41, 128, 185));
        jbtDiscount.setBackground(new Color(52, 152, 219));
        jpTaskContent.add(new TrainNFarePanel(), "fare");
        cl.show(jpTaskContent, "fare");
    }//GEN-LAST:event_jbtFareActionPerformed

    private void jbtDiscountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtDiscountActionPerformed
        jbtStation.setBackground(new Color(52, 152, 219));
        jbtRoute.setBackground(new Color(52, 152, 219));
        jbtSchedule.setBackground(new Color(52, 152, 219));
        jbtFare.setBackground(new Color(52, 152, 219));
        jbtDiscount.setBackground(new Color(41, 128, 185));
        jpTaskContent.add(new DiscountPanel(), "discount");
        cl.show(jpTaskContent, "discount");
    }//GEN-LAST:event_jbtDiscountActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jbtDiscount;
    private javax.swing.JButton jbtFare;
    private javax.swing.JButton jbtRoute;
    private javax.swing.JButton jbtSchedule;
    private javax.swing.JButton jbtStation;
    private javax.swing.JPanel jpButtons;
    private javax.swing.JPanel jpTaskContent;
    // End of variables declaration//GEN-END:variables
}
